package l1j.opqlo.Timer.Controler;

import java.util.logging.Level;
import java.util.logging.Logger;

import l1j.server.server.model.Instance.L1PcInstance;

/**
 * PC 可見物更新處理 判斷
 *
 * @author dexc
 *
 */
public class UpdateObjectCheck {

	private static final Logger _log = Logger.getLogger(UpdateObjectCheck.class
			.getName());

	/**
	 * 判斷
	 *
	 * @param tgpc
	 * @return true:執行 false:不執行
	 */
	public static boolean check(final L1PcInstance tgpc) {
		try {
			if (tgpc == null) {
				return false;
			}

			if (tgpc.getOnlineStatus() == 0) {
				return false;
			}

			if (tgpc.getNetConnection() == null) {
				return false;
			}

			if (tgpc.isTeleport()) {
				return false;
			}

		} catch (final Exception e) {
			_log.log(Level.WARNING, e.getLocalizedMessage(), e);
			return false;
		}
		return true;
	}
}
